The F# Computation Expression Zoo
نویسندگان
چکیده
Many computations can be structured using abstract computation types such as monoids, monad transformers or applicative functors. Functional programmers use those abstractions directly while mainstream languages often integrate concrete instances as language features – e.g. generators in Python or asynchronous computations in C# 5.0. The question is, is there a sweet spot between convenient, hardwired language features, and an inconvenient but flexible libraries? F# computation expressions answer this question in the affirmative. Unlike the “do” notation in Haskell, computation expressions are not tied to a single kind of abstraction. They support a wide range of computations, depending on what operations are available. They also provide greater syntactic flexibility leading to a more intuitive syntax, without resorting to full macro-based meta-programming. We show that computation expressions can structure well-known computations including monoidal list comprehensions, monadic parsers, applicative formlets and asynchronous sequences based on the list monad transformer. We also present typing rules for computation expressions that are capable of capturing all these applications.
منابع مشابه
Sorting out tigers (Panthera tigris): mitochondrial sequences, nuclear inserts, systematics, and conservation genetics
Sequences from complete mitochondrial cytochrome b genes of 34 tigers support the hypothesis that Sumatran tigers are diagnostically distinct from mainland populations. None of the latter, including Bengals, Siberians, or Indochinese tigers, were found to have fixed diagnostic characters. Phylogenetic analysis of these sequences confirms these results. Within the framework of a phylogenetic spe...
متن کاملPrevalence of bovine tuberculosis in zoo animals in Pakistan
The study was carried out in zoo animals at Islamabad Zoo, Pakistan to know the prevalence of bovinetuberculosis. An overall prevalence of 3.3% was recorded in zoo animals with 3.6% in Bovidae, 3.2% inCervidae and 0% in Equidae families. The positive animals included spotted deer (1/3; 95% CI = 0.84,90.57), Chinkara gazella (1/5; 95% CI = 0.51, 71.64) and Blackbuck gazelle (1/30; 95% CI = 0.08,...
متن کاملFinding Volunteers' Engagement Profiles in Human Computation for Citizen Science Projects
Human computation is a computing approach that draws upon human cognitive abilities to solve computational tasks for which there are so far no satisfactory fully automated solutions even when using the most advanced computing technologies available. Human computation for citizen science projects consists in designing systems that allow large crowds of volunteers to contribute to scientific rese...
متن کاملFour Apt Elementary Examples of Recursion
We give four elementary examples of recursion that are reallife, non-trivial, more natural than the corresponding iterative approach, and do not involve any sophisticated algorithms, data structures, or mathematical problems. The examples are two forms of writing numbers in words, coalescing page references for an index, and finding unclosed begin blocks. My New Zoo, McGrew Zoo, will make peopl...
متن کاملSome Thoughts on a Framework for Crowdsourcing A Position Paper for the CHI 2011 Workshop on Crowdsourcing and Human Computation
First, some crowdsourcing systems add value because they can perform a task more quickly than an individual. Examples include von Ahn’s ESP Game [14] in which people generate textual labels for images, or Galaxy Zoo [7] in which people classify images of galaxies as spiral or elliptical. This is usually managed by recruiting large numbers of people to perform one or two very simple tasks, and c...
متن کاملذخیره در منابع من
با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید
عنوان ژورنال:
دوره شماره
صفحات -
تاریخ انتشار 2014